<?php
$this->houseme_view->header();
?>
    <!-- masonry page nav-->
    <?php if(isset($page_next_link)){ ?>
    <div id="page-nav"><a id="page-next-link" href="<?php echo $page_next_link; ?>"></a></div>
    <?php } ?>
    <!-- masonry page nav-->

    <!--照片清單-->
    <div id="photoList">
    <ul>      
        
        <?php if(!empty($user_collected)){ ?>

            <?php foreach ($user_collected as $key => $post) {
            ?>

                <?php if(isset($post['topic_desc'])) { ?><!--topic-->
                <li>
                        <?php if($post['topic_category'] == '案例分享'){ ?>
                            <div class="indexTitle_03">
                        <?php }elseif($post['topic_category'] == '人物訪談'){ ?>
                            <div class="indexTitle_02">
                        <?php }else{ ?>
                            <div class="indexTitle_01">
                        <?php } ?>
                        <?php echo $post['topic_category']; ?></div>
                        <?php
                            $doc = new DOMDocument();
                            @$doc->loadHTML($post['topic_desc']);
                            $first_img = $doc->getElementsByTagName('img')->item(0);
                            $first_img_src = $first_img->attributes->getNamedItem("src")->value;
                        ?>
                        <img src="<?php echo $first_img_src; ?>" width="200" height="150" />
                        <div class="btn_collect"><span>/topic/detail/<?php echo $post['id'].'/'; ?></span></div>
                        <a href="/topic/detail/<?php echo $post['id'].'/'; ?>">
                        <div class="photoListInfo_06"><?php echo $post['topic_excerpt']?></div></a>
                    </li>

                

                <?php }elseif(isset($post['reject_reason'])){ ?>

                <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                <img src="<?php echo $this->config->item('image_uploader_fe_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
               
                <div class="btn_collect"><span>/share/detail/<?php echo $post['id'].'/'; ?></span></div>
                <a href="/share/detail/<?php echo $post['id'].'/'; ?>">
                <div class="photoListInfo_02">
                <?php echo $post['post_excerpt'] ?>
                </div></a></li>


                <?php }else{ ?>  <!--post-->
                <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                <img src="<?php echo $this->config->item('image_uploader_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
                
                <div class="btn_collect"><span>/post/detail/<?php echo $post['id'].'/'; ?></span></div>
                <a href="/post/detail/<?php echo $post['id'].'/'; ?>">
                <div class="photoListInfo_01">
                <?php echo $post['post_excerpt'] ?>
                </div></a></li>
                    
                <?php } ?>
                
            <?php } ?>
        <?php } ?>
    </ul>
    <?php if(!empty($user_collected)){ ?>
        <div id="infscr-loading"><img alt="Loading..." src="/assets/img/ajax-loading.gif" /><div>Loading....</div></div>
    <?php }else{ echo $this->lang->line('can_not_find_post'); } ?>
    <div class="endSpan"></div>
    </div>
<?php
$this->houseme_view->footer();
?>